package com.demo.system.auth.controller;


import com.demo.common.response.Result;
import com.demo.system.auth.model.dto.LoginDto;
import com.demo.system.auth.service.AuthService;
import com.demo.system.service.UserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


/**
 * 认证控制层
 *
 * @author why
 * @since 2022/10/16
 */
@RestController
@RequestMapping("/auth")
@RequiredArgsConstructor
@Slf4j
public class AuthController {

    private final AuthService authService;

    @PostMapping("/login")
    public Result<?> login(@RequestBody LoginDto userLogin) {
        return authService.login(userLogin.getUsername(), userLogin.getPassword());
    }
}
